import time


def metric(fn):
    start_time = time.time()
    print('%s start_time at %0.4f' % (fn.__name__, start_time))
    time.sleep(0.5)
    end_time = time.time()
    print('%s end_time at %0.4f' % (fn.__name__, end_time))
    print('耗时：{:.10f}s'.format(end_time - start_time))
    return fn


@metric
def a(x, y):
    time.sleep(0.5)
    return x + y


a(3, 5)
